#ifndef _XBOOK_CLOCK_H
#define _XBOOK_CLOCK_H

#include <types.h>

extern volatile clock_t systicks;
/* 基于systicks的时间 */
#define time_after(unknown, known) ((long)(known) - (long)(unknown) < 0)
#define time_before(unknown, known) ((long)(unknown) - (long)(known) < 0)
#define time_after_eq(unknown, known) ((long)(known) - (long)(unknown) <= 0)
#define time_before_eq(unknown, known) ((long)(unknown) - (long)(known) <= 0)

void init_clock();
clock_t sys_get_ticks();
clock_t clock_delay_by_ticks(clock_t ticks);
void mdelay(time_t msec);

#endif   /* _XBOOK_CLOCK_H */